package com.mz.auth.service.impl;

import com.mz.auth.entity.DicType;
import com.mz.auth.entity.DicTypeData;
import com.mz.auth.mapper.DicMapper;
import com.mz.auth.query.BaseQuery;
import com.mz.auth.service.DicService;
import com.mz.auth.util.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DicServiceImpl implements DicService {
    @Autowired
    DicMapper dicMapper;

    @Override
    public List<DicTypeData> findLevels() {
        List<DicTypeData> levels = dicMapper.findLevels();
        return levels;
    }

    @Override
    public PageList listpage(BaseQuery baseQuery) {
        PageList pageList=new PageList();
        pageList.setTotal(dicMapper.queryTotal(baseQuery));
        pageList.setRows(dicMapper.queryData(baseQuery));
        return pageList;
    }

    @Override
    public List<DicType> queryDicType() {
        return dicMapper.queryDicType();
    }

    @Override
    public DicType queryDicTypeInfoById(Long id) {
        return dicMapper.queryDicTypeInfoById(id);
    }

    @Override
    public void saveDicType(DicType dicType) {
        dicMapper.saveDicType(dicType);
    }

    @Override
    public void editSaveDicType(DicType dicType) {
        dicMapper.editSaveDicType(dicType);
    }
}
